package cn.tedu.tourism.room.service.impl;

import cn.tedu.tourism.room.mapper.RoomMapper;
import cn.tedu.tourism.room.pojo.dto.RoomQuery;
import cn.tedu.tourism.room.pojo.vo.RoomVO;
import cn.tedu.tourism.room.service.RoomService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Slf4j
@Service
public class RoomServiceImpl implements RoomService {

    @Autowired
    private RoomMapper roomMapper;

    @Override
    public List<RoomVO> select(RoomQuery roomQuery) {
        log.debug("查询酒店房间信息业务：{}",roomQuery);
        List<RoomVO> list = roomMapper.select(roomQuery);
        log.debug("查询酒店房间信息结果：{}",list);
        return list;
    }

    @Override
    public List<RoomVO> selectMinPrice(Long hotelId) {
        log.debug("查询酒店房间最低价格：{}",hotelId);
        List<RoomVO> list = roomMapper.selectMinPrice(hotelId);
        return list;
    }
}
